

<?php
//接受数据
$cid=$_POST["cid"];
$name=$_POST["name"];
$email=$_POST["email"];
$message=$_POST["message"];
mysql_connect("localhost","root");
mysql_select_db("close");
mysql_query("set names utf8");
$res=mysql_query("insert into comments values(null,$cid,'$name','$email','$message',now())");

//重定向回刚才的页面
header("location:single.php?id=$cid");